package com.gamefx.mvc
{
	import com.gamefx.mvc.classes.Notifier;

	/**
	 * Model是数据的持有者，负责保存或获取数据，以及与远程服务的交互
	 * Model不关注Notification，只在所持有的数据被修改时，发送Notification通知相关模块
	 * 
	 * @author hzf
	 * 
	 */
	public class Model extends Notifier
	{
		protected var modelName:String;

		protected var data:Object;


		/**
		 * Constructor
		 */
		public function Model(modelName:String = null, data:Object = null)
		{
			this.modelName = (modelName != null) ? modelName : Facade.Name(this);

			if (data != null)
			{
				setData(data);
			}
		}

		public function getModelName():String
		{
			return modelName;
		}

		public function setData(data:Object):void
		{
			this.data = data;
		}

		public function getData():Object
		{
			return data;
		}


	}
}
